﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DLV.Utilities;

namespace DLV.Data.Entities
{
    public class BookingController
    {
        public int InsertBooking(BookingInfo info)
        {
            return SQL.InsertBooking(info.BookQuantityAdult, info.BookQuantityChild, info.BookQuantityBaby, info.BookCusId, info.BookPayments, info.BookTourId, info.BookBeginLocation, info.BookEndLocation, info.BookOtherRequest, info.BookDeposit, info.BookCreatedBy, info.BookCreatedDate, info.BookUpdatedBy, info.BookUpdatedDate, info.BookStatus);
        }
        public void UpdateBooking(BookingInfo info)
        {
            SQL.UpdateBooking(info.BookQuantityAdult, info.BookQuantityChild, info.BookQuantityBaby, info.BookCusId, info.BookPayments, info.BookTourId, info.BookBeginLocation, info.BookEndLocation, info.BookOtherRequest, info.BookDeposit, info.BookCreatedBy, info.BookCreatedDate, info.BookUpdatedBy, info.BookUpdatedDate, info.BookStatus,info.BookId);
        }
        public void DeleteBooking(BookingInfo info)
        {
            DeleteBooking(info.BookId);
        }
        public void DeleteBooking(int bookId)
        {
            SQL.DeleteBooking(bookId);
        }
        public BookingInfo GetBooking(int bookId)
        {
            return CBO.FillObject<BookingInfo>(SQL.GetBooking(bookId));
        }
        public List<BookingInfo> ListBooking()
        {
            return CBO.FillCollection<BookingInfo>(SQL.ListBooking());
        }
        public DataTable SelectBooking()
        {
            return CBO.ConvertToDataTable(ListBooking(), typeof(BookingInfo));
        }
    }
}
